<template>
    <div class="modal fade" id="batchToM2Modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          	<div class="modal-header">
            	<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            	<h4 class="modal-title" id="myModalLabel"> 转客备注消息</h4>
          	</div>
          	<div class="modal-body">
          	 	<div class="form-horizontal">
          	 		<div class="form-group">
	                  <label class="col-md-4 col-sm-2 control-label">转客数量：</label>
						<div class="col-md-8 col-sm-10">
							<div class="form-control">
								<span>{{ToM2InfoModal.num}}</span>
							</div>
						</div>
	                </div>
	                <div class="form-group">
	                  <label for="" class="col-sm-4 control-label">备注信息：</label>
	                  <div class="col-sm-8">
	                    <textarea rows="5" class="form-control" v-model="params.remark" placeholder="请填写备注信息"></textarea>
	                  </div>
	                </div>
	            </div>
          	</div>
          	<div class="modal-footer">
            	<button type="button" class="btn checkedBtn"  @click="saveFollow" :disabled="isShow">确定</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
          	</div>
        </div>
      </div>
    </div>
</template>

<script>
	export default{
		//接收父组件的绑定值
		props: ["ToM2InfoModal"],
		data() {
			return {
				//机构信息对象
				params: {
					remark: '',
					cusPreId:''
				},
				isShow:false
			}
		},
		components:{
			
		},
		mounted:function(){
			
		},
		methods: {
            saveFollow: function() {
                const _self = this;
                const url = this.utilHelper.apiUrl+'/api/customerToM2';
                const body = {};
                _self.isShow = true;
                _self.params.cusPreId = _self.ToM2InfoModal.ids;
                body.params =_self.params;
                _self.$http.post(url,body).then((response) =>{
                	 _self.isShow = false;
                    const res = response.body.resData;
                    if(res.result == '1') {
                        $('#batchToM2Modal').modal('hide');
                        _self.$emit('batchToM2Listener',res);
                    }else {
                        layer.msg("转客失败");
                     //   $('#batchToM2Modal').modal('hide');
               		//	_self.$emit('batchToM2Listener',res);
                    }
                },(response)=>{
                	_self.isShow=false;
                    layer.msg("转客失败");
                });
			}
		}
	}
	
</script>